package model;

import java.util.Collection;

public abstract class State {

	public abstract boolean isAlive();

	public abstract State nextStateFor(Cell cell);
	
	protected int countAmountAliveNeighbours(Cell cell){
			Collection<Cell> neighbours = cell.getNeighbours();
			int neighboursAlive = 0;
			for (Cell cell2 : neighbours) {
				if (cell2.isAlive()){
					neighboursAlive++;
				}
			}
			return neighboursAlive;
	}
}
